docker rm -f redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5 redis-node-6

docker run -d --name redis-node-1 --net host --privileged=true -v /usr/local/repository/redis/redis-node-1/redis.conf:/etc/redis/redis.conf -v /usr/local/repository/redis/redis-node-1/data:/data redis:6.0.8 --cluster-enabled yes --appendonly yes --port 6381
 
docker run -d --name redis-node-2 --net host --privileged=true -v /usr/local/repository/redis/redis-node-2/redis.conf:/etc/redis/redis.conf -v /usr/local/repository/redis/redis-node-2/data:/data redis:6.0.8 --cluster-enabled yes --appendonly yes --port 6382

docker run -d --name redis-node-3 --net host --privileged=true -v /usr/local/repository/redis/redis-node-3/redis.conf:/etc/redis/redis.conf -v /usr/local/repository/redis/redis-node-3/data:/data redis:6.0.8 --cluster-enabled yes --appendonly yes --port 6383

docker run -d --name redis-node-4 --net host --privileged=true -v /usr/local/repository/redis/redis-node-4/redis.conf:/etc/redis/redis.conf -v /usr/local/repository/redis/redis-node-4/data:/data redis:6.0.8 --cluster-enabled yes --appendonly yes --port 6384

docker run -d --name redis-node-5 --net host --privileged=true -v /usr/local/repository/redis/redis-node-5/redis.conf:/etc/redis/redis.conf -v /usr/local/repository/redis/redis-node-5/data:/data redis:6.0.8 --cluster-enabled yes --appendonly yes --port 6385

docker run -d --name redis-node-6 --net host --privileged=true -v /usr/local/repository/redis/redis-node-6/redis.conf:/etc/redis/redis.conf -v /usr/local/repository/redis/redis-node-6/data:/data redis:6.0.8 --cluster-enabled yes --appendonly yes --port 6386

#docker exec -it redis-node-1 /bin/bash
#redis-cli --cluster create 192.168.202.200:6381 192.168.202.200:6382 192.168.202.200:6383 192.168.202.200:6384 192.168.202.200:6385 192.168.202.200:6386 --cluster-replicas 1
# --cluster-replicas 1 表示为每个master创建一个slave节点

